import yaml
from datetime import datetime
import logging
import pythoncom

#get the logger instance for this app
logger = logging.getLogger('provinci')

class Request(object):
    
    def __init__(self, requester):
        self.guid = str(pythoncom.CreateGuid())
        self.timestamp = datetime.now()
        self.requester = requester
        self.filesets = []
        
    def __str__(self):
        return '%s - %s: %s' % (self.timestamp, self.requester,self.filesets)

class Requester(object):
    
    def __init__(self, given, family, address):
        self.given = given
        self.family = family
        self.address = address

    def __str__(self):
        return '%s %s, %s' % (self.given, self.family, self.address)

class FileSet(object):
    
    def __init__(self, description, comment):
        self.description = description
        self.comment = comment

    def __str__(self):
        return '%s: %s' % (self.description, self.comment)

class Response(object):
    
    def __init__(self, guid, response):
        self.guid = guid
        self.response = response

    def __str__(self):
        return '%s' % (self.response)


if __name__ == '__main__':
    #TEST
    requester = Requester('berco', 'beute', 'marnelaan')
    fileset = FileSet('wicked discription', 'Some bogus comment')
    request = Request(requester)
    request.filesets.append(fileset)
    print yaml.dump(request, default_flow_style=False)